/**
 * 
 */
package com.scpii.universal.hibernate.dao.impl;


import org.springframework.stereotype.Repository;

import com.scpii.universal.constant.GenericConstants;
import com.scpii.universal.hibernate.dao.AppStyleImgDao;
import com.scpii.universal.hibernate.entity.AppStyleImgTab;


/**
 * genericWeb
 * @author acer
 * 2012-7-5下午04:35:11
 */
@Repository
public class AppStyleImgDaoImpl extends BaseDaoImpl<AppStyleImgTab, Integer> implements AppStyleImgDao{

	@Override
	public AppStyleImgTab getStyleImgById(int id, int type) {
		StringBuffer hql = new StringBuffer();
		hql.append("select new AppStyleImgTab(");
		hql.append("a.intAppSytleImgId,a.intAppStyleImgType,a.varAppStyleImgUrl)");
		hql.append(" from AppStyleImgTab a where a.intDeleteSign=?");
		hql.append(" and a.intAppStyleImgType=? and a.intAppStyleId=?");
		return (AppStyleImgTab) getHibernateTemplate().getSessionFactory()
				.getCurrentSession().createQuery(hql.toString()).setParameter(
						0, GenericConstants.DELETE_SIGN_EXIST).setParameter(1,
						type).setParameter(2, id).uniqueResult();
	}
	
}
